package cn.gzjp.modules.rice.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

/**
 * 代金券记录Entity
 * @author zengcp
 * @version 2018-12-01
 */
public class RiceCashCoupon extends DataEntity<RiceCashCoupon> {
	
	private static final long serialVersionUID = 1L;
	private String openid;		// openid
	private String name;		// 代金券名称
	private int amount;		// 金额
	private Date endDate;		// 有效期
	private String status;  //0 未使用  1已使用
	
	public RiceCashCoupon() {
		super();
	}

	public RiceCashCoupon(String id){
		super(id);
	}

	@Length(min=0, max=32, message="openid长度必须介于 0 和 32 之间")
	@ExcelField(title="openid", align=2, sort=1)
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	@Length(min=0, max=128, message="代金券名称长度必须介于 0 和 128 之间")
	@ExcelField(title="代金券名称", align=2, sort=2)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="有效期", align=2, sort=4)
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}
}